#ifndef __BSP_ADC_H
#define __BSP_ADC_H


#include "gd32e23x.h"
#include "gd32e230c_eval.h"
#include "systick.h"
#include "FreeRTOS.h"
#include "task.h"

void adc_config(void);

uint16_t adc_channel_sample(uint8_t channel);

uint16_t get_bat_volt(void);

uint16_t sliding_average_filter(uint16_t value, uint16_t *ptick);

uint8_t bat_led_gear(uint16_t volt);

#endif  //__BSP_ADC_H

